<!DOCTYPE html>
<html>
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<head>
		<meta charset="utf-8" />
		<title>Search Order Page Info</title>
		<link rel="stylesheet" href="style.css" type="text/css" media="screen" title="Stylesheet" charset="utf-8" />
	</head>
	<body style="background-color: #092E67;;">
	
		<div class="info" style="font-size: 12pt;">
			
			<p>Sending data from multiple data object to the business logic is done using MyStroBE transaction object: DSTransactionManager.</p>

			<p>Transaction manager will take changed data from one or multiple data objects and send them to business logic address that can handle. 
			Business logic classes with data sets made up of multiple temp tables will handle the requests coming from UI transaction objects.</p>
			
			<p>On the UI we have generated classes that hold the information required to send data to business logic classes.
			Below you can see example of a transaction call:</p>         
		
			<div style="padding-left: 50px; padding-top:10px;  font-size: 10pt; color: #21759B; font-style: italic;">	
				..<br/>
				DSTransactionManager transactionManager = new DSTransactionManager(new OrderInfoDSSchema(),<br/>
				&nbsp;&nbsp;AppConnector.getInstance(), new IDSTransactionable&lt;?&gt; [] { orderDO, orderLineDO } ); <br/>
				<br/>
				for(OrderLine orderLine : this.orderLinesList ) {<br/>
				<br/>	
				&nbsp;&nbsp;if (orderLine.getRowId() != null) {<br/>
				&nbsp;&nbsp;&nbsp;&nbsp;orderLineDO.moveToRow(orderLine.getRowId());<br/>
				&nbsp;&nbsp;&nbsp;&nbsp;		if (orderLineHasChanges(orderLineDO.getData(), orderLine)) {<br/>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;			orderLineDO.updateData();<br/>
				&nbsp;&nbsp;&nbsp;&nbsp;		}<br/>
				&nbsp;&nbsp;		rowIdsMap.put(orderLine.getRowId(), null);<br/>
				&nbsp;&nbsp;<br/>	
				&nbsp;&nbsp;	} else {<br/>
				&nbsp;&nbsp;&nbsp;&nbsp;		//create order line<br/>
				&nbsp;&nbsp;&nbsp;&nbsp;		orderLineDO.createData(orderLine);<br/>
				&nbsp;&nbsp;&nbsp;&nbsp;		orderLineDO.updateData();<br/>
				&nbsp;&nbsp;	}<br/>
				}<br/>
				<br/>
				&nbsp;&nbsp;List&lt;OrderLine&gt; orderLinesToRemove = new ArrayList&lt;OrderLine&gt;();<br/>
				&nbsp;&nbsp;for (OrderLine orderLine : orderLineDO.getDataBuffer()) {<br/>
					<br/>
				&nbsp;&nbsp;&nbsp;&nbsp;	if (orderLine.getRowId() != null && <br/>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;			!rowIdsMap.containsKey(orderLine.getRowId())) { <br/>
				&nbsp;&nbsp;&nbsp;&nbsp;		orderLinesToRemove.add(orderLine); <br/>
				&nbsp;&nbsp;	}<br/>
				}<br/>
				<br/>
				&nbsp;&nbsp;for (OrderLine orderLine : orderLinesToRemove) {<br/>
				&nbsp;&nbsp;&nbsp;&nbsp;	orderLineDO.moveToRow(orderLine.getRowId());<br/>
				&nbsp;&nbsp;&nbsp;&nbsp;	orderLineDO.deleteData();<br/>
				&nbsp;&nbsp;}<br/>
				<br/>
				orderDO.updateData();<br/>
				<br/>
				transactionManager.commit();<br/>
				..	
			</div>
			
			<p>In the above example 'OrderInfoDSSchema' class was generated by making a special call to the business logic class,
			 using MyStroBe generator. Generator is not used at runtime, classes are created one the business logic is ready to receive requests.
			 Generated classes are the business logic classes place holders for the UI.</p>   
				
		</div>
	
	</body>
</html>